package com.kanche.bigbaby.adapter;

import android.support.v4.view.ViewPager;
import android.view.View;

/**
 * Created by Chenshao_Young on 15/5/17.
 * http://andraskindler.com/blog/2013/create-viewpager-transitions-a-pagertransformer-example/
 */
public class AndraskPageTransformer implements ViewPager.PageTransformer {
    @Override
    public void transformPage(View page, float position) {

        final float normalizedposition = Math.abs(Math.abs(position) - 1);
        page.setAlpha(normalizedposition);
        page.setScaleX(normalizedposition / 2 + 0.5f);
        page.setScaleY(normalizedposition / 2 + 0.5f);


//        page.setRotationY(position * -30);
    }
}
